#include <stdio.h>
int main(void)
{
 int TimePoint;
 do {
 	TimePoint = 24; //每次循环设置初值为24，使得输入其他不合要求的字符（如,.*a b c）时都执行为invalid 
  scanf("%d",&TimePoint);
  getchar();//防止输入\字符时死循环 
  if(TimePoint>=0&&TimePoint<12)
  {printf("good morning.\n");
  }
  else if(TimePoint==12)
  {printf("good noon.\n");
  }
  else if(TimePoint>=13&&TimePoint<18)
  {printf("good afternoon.\n");
  }
 else if(TimePoint>=18&&TimePoint<21)
 {printf("good evening.\n");
 }
 else if(TimePoint>=21&&TimePoint<24)
 {printf("good night.\n");
 }
 else
 {printf("the input is invalid.\n");
 }
 }while(1);//循环执行判断条件 
 return 0;
}


//以下是题目
/*Lab 2-1 (2分)
Key in a time of hour randomly, print good morning/noon/afternoon/evening/night respectively. Note that the roughly partition of a day is as follow:
1) Morning: The first or early part of the day, lasting from midnight to noon or from sunrise to noon. 
[0, 12)
2) Noon: Twelve o'clock in the daytime; midday.  [12]
3) Afternoon: The part of day from noon until sunset. Say, after 13 o’clock.  [13, 18)
4) Evening: The period of decreasing daylight between afternoon and night, after eighteen o’clock. 
[18, 21)
5) Night: The period between sunset and sunrise, especially the hours of darkness. To ensure the whole day and night are included, we suggest that it begin at 21 o’clock.  [21, 24)

I/O Examples: *Note that the input/output must follow the format below.
8
good morning.
12
good noon.
17 
good afternoon.
19
good evening.
22
good night.
-1 
the input is invalid.*/
